<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Binh
 * Date: 1/6/14
 * Time: 9:07 PM
 * To change this template use File | Settings | File Templates.
 */
use \Model;

class Controller_ListSong extends Controller{
    private $view;

    public function __construct(){
        //Cài đặt view
        $this->view = View::forge('home/layout');
        $this->view->head = View::forge('home/head');
        $this->view->header = View::forge('home/header');
        $this->view->footer = View::forge('home/footer');
        $this->view->layout_list_song = View::forge('home/layout_list_song');

        //Cài đặt biến toàn cục
        $this->view->set_global('site', 'layout_list_song');
    }

    private function set_layout($genre, $songs){
        $this->view->set_global('genre', $genre);
        $this->view->set_global('songs', $songs);

        return $this->view;
    }

    public function action_Viet_Nam_The_Loai_Pop(){
        return $this->set_layout("Pop", \Model\Song::get_genre_id(6));
    }
    public function action_Viet_Nam_The_Loai_Rock(){
        return $this->set_layout("Rock", \Model\Song::get_genre_id(7));
    }
    public function action_Viet_Nam_The_Loai_Rap(){
        return $this->set_layout("Rap", \Model\Song::get_genre_id(8));
    }
    public function action_Viet_Nam_The_Loai_Khong_Loi(){
        return $this->set_layout("Không Lời", \Model\Song::get_genre_id(9));
    }

    public function action_Nuoc_Ngoai_The_Loai_Pop(){
        return $this->set_layout("Pop", \Model\Song::get_genre_id(1));
    }
    public function action_Nuoc_Ngoai_The_Loai_Rock(){
        return $this->set_layout("Rock", \Model\Song::get_genre_id(2));
    }
    public function action_Nuoc_Ngoai_The_Loai_Rap(){
        return $this->set_layout("Rap", \Model\Song::get_genre_id(3));
    }
    public function action_Nuoc_Ngoai_The_Loai_RNB(){
        return $this->set_layout("RNB", \Model\Song::get_genre_id(4));
    }
    public function action_Nuoc_Ngoai_The_Loai_Nhac_Han(){
        return $this->set_layout("Nhạc Hàn", \Model\Song::get_genre_id(5));
    }
}